#include<iostream>
using namespace std;
class stock{
public:
	void print()
	{cout<<"stock class.\n";}
};
class der1_stock:public stock{
public:
	void print ()
	{cout<<"der1_stock class.\n";}
};
class der2_stock:public stock{
public:
	void print ()
	{cout<<"der2_stock class.\n";}
};
int main()
{stock s1;
stock *ptr;
der1_stock d1;
der2_stock d2;
ptr=&s1;
ptr->print();
ptr=&d1;
ptr->print();
ptr=&d2;
ptr->print();
return 0;
}
